UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zFRmZbkdzV9vcBey/rAzIxSVgpg3od0QrP1NMgflMjA='
WHERE
key_id = 'c808a5effa1aa265f170c53bd1aa4cc6ca7d65d48877841aab0e7ce6b704cb94'
AND (
token = 'zFRmZbkdzV9vcBey/rAzIxSVgpg3od0QrP1NMgflMjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)