UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kKRUswIqrZqPhVApdT8SDrK+0AJEi3DhVNPDG3Qmb0Y='
WHERE
key_id = 'adccacee37c6ebc0f13d3f30cb8195921f7472cb48e3b155992fe24a0302ce8b'
AND (
token = 'kKRUswIqrZqPhVApdT8SDrK+0AJEi3DhVNPDG3Qmb0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)