UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksvz7aelpvdajBE5OFNlUC7shOSOLmOjU9az4Jlfg0o='
WHERE
key_id = '18384a0aa0fa2f86640f5e4bef5222d9de72a689c3f4749671010564367a48d1'
AND (
token = 'ksvz7aelpvdajBE5OFNlUC7shOSOLmOjU9az4Jlfg0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)