UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SnWecqDlRR9yzZ2youBXU5cy91Lct7Gzx8+N+WrPNQo='
WHERE
key_id = '72c4c8bd300464d0e253b6bdcd91d1d334a9d439299c2350846e049ff46ab80f'
AND (
token = 'SnWecqDlRR9yzZ2youBXU5cy91Lct7Gzx8+N+WrPNQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)