UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rG4MAA84U02dkNGn8Fk8EjUSx/l9BZdionb37naM+XY='
WHERE
key_id = 'bc9b6849d94d5934bccd0bd5acaadcb269109b26370ff8ca59adcb3868d00934'
AND (
token = 'rG4MAA84U02dkNGn8Fk8EjUSx/l9BZdionb37naM+XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)