UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b99ot03bBGoI0miK5SnjgPnJyCT9OKzRmhl8qvC/eok='
WHERE
key_id = '694592ada98117e3cfa508be40b098ece8550339bdb2b320f6348a045c1b5c85'
AND (
token = 'b99ot03bBGoI0miK5SnjgPnJyCT9OKzRmhl8qvC/eok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)