UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YaHudnMeCAqjDPnagqGTdgGCKCaQC4IKVgnk8fSlQYA='
WHERE
key_id = '1508abd6a568d2f8e08f3d1fa6b2cc37c306cbb84448f891e062269aa80cbd87'
AND (
token = 'YaHudnMeCAqjDPnagqGTdgGCKCaQC4IKVgnk8fSlQYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)