UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kSmP5DPSplqM4JbtYi38THLe6UW0I22DRpgzNnses54='
WHERE
key_id = 'a5c787a9a88ae3be23f74b1a0ee824cf6791abfe66735018406d052f5e9cd129'
AND (
token = 'kSmP5DPSplqM4JbtYi38THLe6UW0I22DRpgzNnses54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)