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

Query time 0.00027