UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YEWiUNR5B655AwZfH0oWjWd/1gD8RzSHnsviziHqs7c='
WHERE
key_id = '51842c2393ab8ea5a367746ac22c3c73aaab2ca888be26719dacd765612fd762'
AND (
token = 'YEWiUNR5B655AwZfH0oWjWd/1gD8RzSHnsviziHqs7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)