UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z4cP4imQXcG/liQlCWFDN5nfLW5d/PIyWTFpG6GUsos='
WHERE
key_id = 'f96a14d5b45b916dddfe4fa35cef3d354a28a6f3207d04082492b6c25eb26038'
AND (
token = 'z4cP4imQXcG/liQlCWFDN5nfLW5d/PIyWTFpG6GUsos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)