UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u/fwWYWgWgneLJrpEXKHKnbnle8Yq/i6/u+J38lwA5A='
WHERE
key_id = 'b6c5ba2e9c72634b28694f7801932375fa26a7bfdf1104f7b6aca44aeb9b4b9b'
AND (
token = 'u/fwWYWgWgneLJrpEXKHKnbnle8Yq/i6/u+J38lwA5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)