UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sXaOyS93hH8JCjYleubMZr8kUFNGxh5KoVzk2DOv53U='
WHERE
key_id = '3b743bd756cb4a5d85e2759bffc585e4512e79d10ec76251dc3bc89499b29454'
AND (
token = 'sXaOyS93hH8JCjYleubMZr8kUFNGxh5KoVzk2DOv53U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)