UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4ynAgcp7dI/BXw02h0BbAiw1Jj0HHIzHtxe0S0EF6o=' 
WHERE 
  key_id = 'b6961df1ef6255a6b0abbc0ca9ec842c1aacb5a29fef5abcd8f170becde61883' 
  AND (
    token = 't4ynAgcp7dI/BXw02h0BbAiw1Jj0HHIzHtxe0S0EF6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016