UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ad1e55U023TXT/WjsPzRuE4NMVpb08AJc+Sit9OUlKE='
WHERE
key_id = '24f30eabd36543d9f8318dec0b5fdc11a8680f06930b925052fde9427535ac5c'
AND (
token = 'Ad1e55U023TXT/WjsPzRuE4NMVpb08AJc+Sit9OUlKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)