UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ykb7Jea3tfjViKdSrdTNaFlNOQzxHxFvirkAZkR01WE=' 
WHERE 
  key_id = '44de80453fbc4c34dd84db5a7291ea76595743dd436071034c768e5a7cd7724f' 
  AND (
    token = 'ykb7Jea3tfjViKdSrdTNaFlNOQzxHxFvirkAZkR01WE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029