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

Query time 0.00033