UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cg4eocXToGbe36gJNmmNlKe6mbSiRB2Ud08V0URRFnk='
WHERE
key_id = 'c808fbb9cad33228cc8b10815c738187d5fcda72e8d3b1b1fac7b629ed87612c'
AND (
token = 'Cg4eocXToGbe36gJNmmNlKe6mbSiRB2Ud08V0URRFnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)