UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xly1cG381Dx11i0Wzz1bUGdqWApNtOmmfNr8InM21lQ=' 
WHERE 
  key_id = 'df3214a7f29f3d9ab2c18669c676d3fedbeab8bc12b0d0dd65399d1e16a52b0b' 
  AND (
    token = 'xly1cG381Dx11i0Wzz1bUGdqWApNtOmmfNr8InM21lQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035