UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GhKbPdFrLVx6eai0BgNuU/Z88A6c4Kj093qzfRDBoc='
WHERE
key_id = 'd2511697d1afe27f7fc9bf466c416bc1625d5417b19cf98d1eb7c8a2491ca057'
AND (
token = '5GhKbPdFrLVx6eai0BgNuU/Z88A6c4Kj093qzfRDBoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)