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