UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/trqoRkkNc9M7TlNxGKD1QcRiPF96y52iaK8pf5mvY=' 
WHERE 
  key_id = '65ac23407a512f1e41a3c661ff0ac5fd58db46b3a938146987929ee12144f2cd' 
  AND (
    token = '1/trqoRkkNc9M7TlNxGKD1QcRiPF96y52iaK8pf5mvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056