UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'es0ZwfTapxLlcFJVu3XRayJtbtgWTScvvjbzvBqSkBI='
WHERE
key_id = '102343b9c2d510f3cbb291a50064e44a3bb58fd80ebd698af057b1db4b0b4e11'
AND (
token = 'es0ZwfTapxLlcFJVu3XRayJtbtgWTScvvjbzvBqSkBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)