UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h0Uwqu4BR3JOexPRtBdlvDA683j2e/YyIhdxayHPEnw=' 
WHERE 
  key_id = '8b7077274007ac4110925766136740a3844bec7ea3e25287b22accbf9f37d2a7' 
  AND (
    token = 'h0Uwqu4BR3JOexPRtBdlvDA683j2e/YyIhdxayHPEnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049