UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S8KEnA/IBtC+4Vr5Fq0Ds6XDOs+2Udy7AxCioab03lU=' 
WHERE 
  key_id = '5b5a3317de897c6b9ae0a410367b77ab550602249b4f5fd0a0ca232497d9668a' 
  AND (
    token = 'S8KEnA/IBtC+4Vr5Fq0Ds6XDOs+2Udy7AxCioab03lU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026