UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GB5kG1b9Esfk2isjLzd4MqYV6p+N1xPBWft5PufUZIM='
WHERE
key_id = '175999c3a91d048b3de01565b3087315b24cc0726844c7c82ba78d226a717363'
AND (
token = 'GB5kG1b9Esfk2isjLzd4MqYV6p+N1xPBWft5PufUZIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)