UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h2bVy7gRSN4E8zppfwpLhkMHbiNNPYNGrrHppYlifB0=' 
WHERE 
  key_id = '7d091bc9b29995f43dc86c73cb265b15f0b7621f7b8cab2113c24c2db12b21ff' 
  AND (
    token = 'h2bVy7gRSN4E8zppfwpLhkMHbiNNPYNGrrHppYlifB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046