UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q9hz49dAL82UvDaGhAcKwRT7WHjr/7QVYJmdMH0nEaM='
WHERE
key_id = 'd89eef79880893f9c7e895394885332d638c847f0d71cbe125eb886e7d0de65b'
AND (
token = 'q9hz49dAL82UvDaGhAcKwRT7WHjr/7QVYJmdMH0nEaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)