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

Query time 0.00020