UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H01k4hbLoSoujcXb/TmiqObuG63cSIIMpN1TG1amfXc=' 
WHERE 
  key_id = '6024ddfa30b15f7fc175211f236ba2961df786b72b2d24f317fa870d7e048f71' 
  AND (
    token = 'H01k4hbLoSoujcXb/TmiqObuG63cSIIMpN1TG1amfXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033