UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EauZIp37pjk6KKfbxYbcNJtfmFz0K1zUn6/Pcha0SOE=' 
WHERE 
  key_id = 'f3fe0689b0a3f234f8fdf9d85ef73cd39e98458eca8b401822218ec8139744ee' 
  AND (
    token = 'EauZIp37pjk6KKfbxYbcNJtfmFz0K1zUn6/Pcha0SOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039