UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LavrD5ono8oDLyaxa5xvX/rzZhqUAdR2bxYPRsZGgmM=' 
WHERE 
  key_id = '484a83e7a5658220f4b9d58bc38b1eead27caba71722dabe1cb15f866984ca2e' 
  AND (
    token = 'LavrD5ono8oDLyaxa5xvX/rzZhqUAdR2bxYPRsZGgmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030